package com.aplink.generic.webservice;

import java.util.ArrayList;

import com.aplink.generic.pojo.ContentData;
import com.aplink.generic.pojo.GenericObject;
import com.aplink.generic.pojo.ObjPropInfo;

public class DataResult {
	public static DataResult obtain(final ArrayList<GenericObject> data,
	        final HttpResponseStatus statusCode) {
		final DataResult dataResult = new DataResult();
		dataResult.mData = data;
		dataResult.setStatusCode(statusCode);
		return dataResult;
	}

	private boolean hasFile;
	private ArrayList<GenericObject> mData;
	private ObjPropInfo mFileObjPropInfo;
	private GenericObject mGenericObject;
	private ContentData mObjPropCol;
	private ResponseStatus mResponseStatus;
	private HttpResponseStatus mStatusCode;

	private String mTable;

	public DataResult() {
	}

	public DataResult(final ArrayList<GenericObject> data) {
		this.mData = data;
	}

	public ContentData getContentData() {
		return this.mObjPropCol;
	}

	public ArrayList<GenericObject> getData() {
		return this.mData;
	}

	public ObjPropInfo getFileObjPropInfo() {
		return this.mFileObjPropInfo;
	}

	public GenericObject getGenericObject() {
		return this.mGenericObject;
	}

	public ResponseStatus getResponseStatus() {
		return this.mResponseStatus;
	}

	public HttpResponseStatus getServerResponse() {
		return this.mStatusCode;
	}

	public String getTable() {
		return mTable;
	}

	public boolean isHasFile() {
		return this.hasFile;
	}

	public void setData(final ArrayList<GenericObject> data) {
		this.mData = data;
	}

	public void setFileObjPropInfo(final ObjPropInfo fileObjPropInfo) {
		this.mFileObjPropInfo = fileObjPropInfo;
	}

	public void setGenericObject(final GenericObject genericObject) {
		this.mGenericObject = genericObject;
	}

	public void setHasFile(final boolean hasFile) {
		this.hasFile = hasFile;
	}

	public void setObjPropCol(final ContentData objPropCol) {
		this.mObjPropCol = objPropCol;
	}

	public void setResponseStatus(final ResponseStatus responseStatus) {
		this.mResponseStatus = responseStatus;
	}

	public void setStatusCode(final HttpResponseStatus statusCode) {
		this.mStatusCode = statusCode;
	}

	public void setTable(String table) {
		mTable = table;
	}
}
